<template>
  <div class="bpl1-bg">
    <div class="el-flex">
      <div class="co-title-name">
        <img src="@/assets/cockpit/subdivision/securityOneMap/item3-title.png" alt="" />
      </div>
      <div class="co-title-right">
        <div class="co-title-breathe"><i></i><i></i><i></i><i></i><i></i><i></i></div>
      </div>
    </div>
    <div class="content">
      <div class="count">
        <div class="item"> <span class="label">全市采矿权企业数：</span><span class="number">50</span>家</div>
        <div class="item"> <span class="label">生产中：</span><span class="number">25</span>家</div>
      </div>
      <div class="chart-box1">
        <div class="bpr2-chartbox">
          <div class="bpr2-chart-bg"></div>
          <div class="box-chart" id="boxChart3">
          </div>

        </div>
        <ul class="zx-list">
          <li v-for="(item, index) in listArr" :key="index">
            <div class="icon" :style="`background:${colorArr[index]}`"></div>
            <div class="label">
              {{ item.label }}

              <span>
                {{ item.value }}
              </span>
            </div>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { Vue, Component } from 'vue-property-decorator'
import Highcharts from 'highcharts/highstock'
import { CockpitApi } from '@/api/cockpit'
@Component({
  name: 'Item3'
})
export default class Item3 extends Vue {
  private colorArr = [
    '#49C384',
    '#2B8EF3',
    '#E42C31',
    '#F79014',
    '#DAFA94',
    '#49C384',
    '#2B8EF3',
    '#E42C31',
    '#F79014',
    '#DAFA94'
  ]
  private options: any = {
    credits: {
      enabled: false
    },
    chart: {
      type: 'pie',
      plotBackgroundColor: null,
      plotBorderWidth: null,
      plotShadow: false,
      backgroundColor: null,
      options3d: {
        enabled: true,
        alpha: 60
      }
    },
    title: {
      text: null
    },
    subtitle: {
      text: null
    },
    plotOptions: {
      pie: {
        size: 110,
        innerSize: 70,
        depth: 20,
        dataLabels: {
          //数据标签
          enabled: false //是否启用
        },
        showInLegend: false
      }
    },
    legend: {
      layout: 'vertical',
      align: 'right',
      // verticalAlign: 'middle',
      floating: true,
      symbolwidth: 6,
      symbolHeight: 6,
      itemStyle: {
        fontSize: '12px',
        color: '#fff',
        fontWeight: 'normal',
        paddingTop: '20px'
      },
      itemHoverStyle: {
        color: '#00EAFF'
      }
    },
    series: [
      {
        name: '占比（%）',
        center: ['24%', '40%'],
        colors: this.colorArr,
        data: [
          ['未拆除', 50],
          ['已拆除', 50],
          ['已延期', 50],
          ['正常使用', 50]
        ]
      }
    ]
  }

  private listArr = [
    {
      value: 10,
      label: '有效期内采矿权'
    },
    {
      value: 9,
      label: '规划保留、已过期采矿权'
    },
    {
      value: 8,
      label: '规划不保留、已过期采矿权'
    }
  ]
  created() {}
  mounted() {
    this.init()
  }
  init() {
    // console.log(this.rankData, 'this.rankData')
    // this.options.series[0].data = this.rankData
    this.chart = new Highcharts.Chart('boxChart3', this.options)
  }
}
</script>
<style lang="scss" scoped>
@import '~@/styles/cockpit.scss';
.bpl1-bg {
  width: 100%;
  height: 100%;
  padding: 16px;
  background: url('~@/assets/cockpit/subdivision/administration/item-bg.png') no-repeat 0/ 100% 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.count {
  display: flex;
  align-items: center;
  background: url('~@/assets/cockpit/subdivision/securityOneMap/count-bg.png') no-repeat;
  background-size: 100% 100%;
  height: 44px;
  color: #fff;
  padding-left: 17px;
  .item {
    margin-right: 50px;
    &:last-of-type {
      margin-right: 0;
    }
  }
  .label {
    color: rgba(0, 181, 211, 1);
    // font-size: 18px !important;
  }
  .number {
    // font-weight: 700;
    font-family: 'Roboto';
    margin-right: 3px;
    font-size: 18px !important;
  }
}
.bpr2-chartbox {
  width: 100%;
  height: 162px;
  position: relative;
  margin-top: 14px;
  margin-left: -20px;
  .box-chart {
    width: 100%;
    height: 100%;
    margin-top: -10px;
  }
  .bpr2-chart-bg {
    width: 172px;
    height: 100px;
    background: url('~@/assets/cockpit/bpr2-chart-bg.png') no-repeat 0/ 100% 100%;
    position: absolute;
    left: 32px;
    top: 44px;
    z-index: -1;
  }
}
.chart-box1 {
  position: relative;
  .zx-list {
    position: absolute;
    right: -26px;
    top: 24px;
    color: #fff;
    font-size: 12px !important;
    display: flex;
    flex-wrap: wrap;
    width: 220px;
    margin-top: 30px;
    li {
      width: 100%;
      display: flex;
      margin-top: 8px;
      .icon {
        width: 10px;
        height: 10px;
        background: rgba(73, 195, 132, 1);
      }
      .label {
        width: calc(100% - 20px);
        margin-left: 10px;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        span {
          margin-left: 4px;
        }
      }
    }
  }
}
</style>
